<?php
/**
 * Created by PhpStorm.
 * User: tjjs
 * Date: 17-8-10
 * Time: 上午9:45
 */

namespace ActionsHttp;


use Data\Suggestion_to_restaurant;
use Data\Suggestion_to_restaurant_DAO;

class RestaurantSuggestionTo extends BaseActionHttp
{
    public function doAction() {
        parent::doAction();
        // 意见内容
        $suggestion_content = $this->data[SUGGESTION_CONTENT];

        if (!$suggestion_content) {
            return $this->SendErrMsg("意见内容不能为空");
        }

        $suggestion_record = new Suggestion_to_restaurant(array());
        $suggestion_record->setSUGGESTION_CONTENT($suggestion_content);
        $suggestion_record->setCREATED_BY(1);
        Suggestion_to_restaurant_DAO::insert($suggestion_record);

        // 返回数据
        $this->ResponseDataToCurrentClient();
    }
}